﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_LH_JIJIANTZ实体层次
//********************************************************************************//
#region Entity
namespace Entity
{
    using System;
    using System.Xml;
    [Serializable()]
    public class YS_LH_JIJIANTZ
    {

        private string m_str_s_zhandianbh;
        /// <summary>
        /// 站点
        /// </summary>
        public string S_ZHANDIANBH { get { return m_str_s_zhandianbh; } set { m_str_s_zhandianbh = value; } }

        private string m_str_s_laihanbh;
        /// <summary>
        /// 来函编号
        /// </summary>
        public string S_LAIHANBH { get { return m_str_s_laihanbh; } set { m_str_s_laihanbh = value; } }

        private string m_str_s_yonghuh;
        /// <summary>
        /// 用户号
        /// </summary>
        public string S_YONGHUH { get { return m_str_s_yonghuh; } set { m_str_s_yonghuh = value; } }

        private decimal? m_dec_i_y;
        /// <summary>
        /// 年
        /// </summary>
        public decimal? I_Y { get { return m_dec_i_y; } set { m_dec_i_y = value; } }

        private decimal? m_dec_i_m1;
        /// <summary>
        /// 1月
        /// </summary>
        public decimal? I_M1 { get { return m_dec_i_m1; } set { m_dec_i_m1 = value; } }

        private decimal? m_dec_i_m2;
        /// <summary>
        /// 2月
        /// </summary>
        public decimal? I_M2 { get { return m_dec_i_m2; } set { m_dec_i_m2 = value; } }

        private decimal? m_dec_i_m3;
        /// <summary>
        /// 3月
        /// </summary>
        public decimal? I_M3 { get { return m_dec_i_m3; } set { m_dec_i_m3 = value; } }

        private decimal? m_dec_i_m4;
        /// <summary>
        /// 4月
        /// </summary>
        public decimal? I_M4 { get { return m_dec_i_m4; } set { m_dec_i_m4 = value; } }

        private decimal? m_dec_i_m5;
        /// <summary>
        /// 5月
        /// </summary>
        public decimal? I_M5 { get { return m_dec_i_m5; } set { m_dec_i_m5 = value; } }

        private decimal? m_dec_i_m6;
        /// <summary>
        /// 6月
        /// </summary>
        public decimal? I_M6 { get { return m_dec_i_m6; } set { m_dec_i_m6 = value; } }

        private decimal? m_dec_i_m7;
        /// <summary>
        /// 7月
        /// </summary>
        public decimal? I_M7 { get { return m_dec_i_m7; } set { m_dec_i_m7 = value; } }

        private decimal? m_dec_i_m8;
        /// <summary>
        /// 8月
        /// </summary>
        public decimal? I_M8 { get { return m_dec_i_m8; } set { m_dec_i_m8 = value; } }

        private decimal? m_dec_i_m9;
        /// <summary>
        /// 9月
        /// </summary>
        public decimal? I_M9 { get { return m_dec_i_m9; } set { m_dec_i_m9 = value; } }

        private decimal? m_dec_i_m10;
        /// <summary>
        /// 10月
        /// </summary>
        public decimal? I_M10 { get { return m_dec_i_m10; } set { m_dec_i_m10 = value; } }

        private decimal? m_dec_i_m11;
        /// <summary>
        /// 11月
        /// </summary>
        public decimal? I_M11 { get { return m_dec_i_m11; } set { m_dec_i_m11 = value; } }

        private decimal? m_dec_i_m12;
        /// <summary>
        /// 12月
        /// </summary>
        public decimal? I_M12 { get { return m_dec_i_m12; } set { m_dec_i_m12 = value; } }

        private decimal? m_dec_i_shurur;
        /// <summary>
        /// 输入人
        /// </summary>
        public decimal? I_SHURUR { get { return m_dec_i_shurur; } set { m_dec_i_shurur = value; } }

        private DateTime? m_DT_d_shururq;
        /// <summary>
        /// 输入日期
        /// </summary>
        public DateTime? D_SHURURQ { get { return m_DT_d_shururq; } set { m_DT_d_shururq = value; } }

        private decimal? m_dec_i_jlzt;
        /// <summary>
        /// 0:正常 -1:删除
        /// </summary>
        public decimal? I_JLZT { get { return m_dec_i_jlzt; } set { m_dec_i_jlzt = value; } }

        private decimal m_dec_id;
        /// <summary>
        /// 主键
        /// </summary>
        public decimal ID { get { return m_dec_id; } set { m_dec_id = value; } }

        private decimal? m_dec_i_liuchengbh;
        /// <summary>
        /// 流程编号
        /// </summary>
        public decimal? I_LIUCHENGBH { get { return m_dec_i_liuchengbh; } set { m_dec_i_liuchengbh = value; } }

        private string m_str_s_shenpiyj;
        /// <summary>
        /// 审批意见
        /// </summary>
        public string S_SHENPIYJ { get { return m_str_s_shenpiyj; } set { m_str_s_shenpiyj = value; } }

        private string m_str_s_guanlikbh;
        /// <summary>
        /// 管理块号
        /// </summary>
        public string S_GUANLIKBH { get { return m_str_s_guanlikbh; } set { m_str_s_guanlikbh = value; } }

        private string m_str_s_caozuorqm;
        /// <summary>
        /// 操作人电子签名图片路径
        /// </summary>
        public string S_CAOZUORQM { get { return m_str_s_caozuorqm; } set { m_str_s_caozuorqm = value; } }
        public YS_LH_JIJIANTZ()
        {
        }
    }
}
#endregion
#region EntityProcess
namespace BLL.Access
{
    using System;
    using System.Data;
    //using System.Data.OracleClient;
    using Entity;
    using System.Configuration;
    using System.Data.Common;
    using Platform.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    using Oracle.DataAccess;
    public class YS_LH_JIJIANTZProcess
    {
        #region Field
        protected string conn;
        #endregion
        #region Construction
        public YS_LH_JIJIANTZProcess() { conn = Platform.Configuration.ConfigHelper.PlatformConnString; }
        #endregion
        #region public

        /// <summary>
        /// 根据YS_LH_JIJIANTZ实体添加或者修改YS_LH_JIJIANTZ信息
        /// </summary>
        public bool InsertOrUpdate(YS_LH_JIJIANTZ YS_LH_JIJIANTZ, OracleTransaction Transaction)
        {
            if (YS_LH_JIJIANTZ.ID == 0)
            {
                InsertYS_LH_JIJIANTZ(YS_LH_JIJIANTZ, Transaction);
            }
            else
            {
                UpdateYS_LH_JIJIANTZ(YS_LH_JIJIANTZ, Transaction);
            }
            return YS_LH_JIJIANTZ.ID == 0 ? false : true;
        }

        /// <summary>
        /// 根据YS_LH_JIJIANTZ实体添加或修改YS_LH_JIJIANTZ信息
        /// </summary>
        public bool InsertOrUpdate(YS_LH_JIJIANTZ YS_LH_JIJIANTZ)
        {
            return InsertOrUpdate(YS_LH_JIJIANTZ, null);
        }



        /// <summary>
        /// 根据YS_LH_JIJIANTZ主键删除YS_LH_JIJIANTZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_LH_JIJIANTZ(decimal ID, OracleTransaction Transaction)
        {
            string spName = "CS_DelYS_LH_JIJIANTZ";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据YS_LH_JIJIANTZ主键删除YS_LH_JIJIANTZ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_LH_JIJIANTZ(decimal ID)
        {
            return DeleteYS_LH_JIJIANTZ(ID, null);
        }

        /// <summary>
        /// 根据条件删除YS_LH_JIJIANTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_LH_JIJIANTZsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            string spName = "CS_DelYS_LH_JIJIANTZsDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据条件删除YS_LH_JIJIANTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_LH_JIJIANTZsDynamic(string WhereClause)
        {
            return DeleteYS_LH_JIJIANTZsDynamic(WhereClause, null);
        }

        /// <summary>
        /// 根据YS_LH_JIJIANTZ主键选择YS_LH_JIJIANTZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_JIJIANTZ信息</returns>
        public YS_LH_JIJIANTZ SelectYS_LH_JIJIANTZ(decimal ID, OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_JIJIANTZ";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                YS_LH_JIJIANTZ YS_LH_JIJIANTZ = PopulateYS_LH_JIJIANTZ(rd);
                rd.Close();
                return YS_LH_JIJIANTZ;
            }
            else
                return null;
        }

        /// <summary>
        /// 根据YS_LH_JIJIANTZ主键选择YS_LH_JIJIANTZ信息
        /// </summary>
        /// <returns>YS_LH_JIJIANTZ信息</returns>
        public YS_LH_JIJIANTZ SelectYS_LH_JIJIANTZ(decimal ID)
        {
            return SelectYS_LH_JIJIANTZ(ID, null);
        }

        /// <summary>
        /// 选择所有YS_LH_JIJIANTZ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_LH_JIJIANTZ信息</returns>
        public DataTable SelectYS_LH_JIJIANTZsAll(OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_JIJIANTZsAll";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }

        /// <summary>
        /// 选择所有YS_LH_JIJIANTZ信息
        /// </summary>
        /// <returns>所有YS_LH_JIJIANTZ信息</returns>
        public DataTable SelectYS_LH_JIJIANTZsAll()
        {
            return SelectYS_LH_JIJIANTZsAll(null);
        }

        /// <summary>
        /// 根据条件选择YS_LH_JIJIANTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_JIJIANTZ信息</returns>
        public DataTable SelectYS_LH_JIJIANTZsDynamic(string WhereClause, string OrderByExpression, OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_JIJIANTZsDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择YS_LH_JIJIANTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_LH_JIJIANTZ信息</returns>
        public DataTable SelectYS_LH_JIJIANTZsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_LH_JIJIANTZsDynamic(WhereClause, OrderByExpression, null);
        }



        /// <summary>
        /// 根据条件选择YS_LH_JIJIANTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_JIJIANTZ信息</returns>
        public DataTable SelectYS_LH_JIJIANTZsDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize, OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_JIJIANTZsDynPaged";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择YS_LH_JIJIANTZ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_LH_JIJIANTZ信息</returns>
        public DataTable SelectYS_LH_JIJIANTZsDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize)
        {
            return SelectYS_LH_JIJIANTZsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///根据条件更新YS_LH_JIJIANTZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_LH_JIJIANTZsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            int result = 0;
            if (UpdateValue == "" || WhereClause == "")
            {
                return 0;
            }
            string spName = "CS_UpdYS_LH_JIJIANTZDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///根据条件更新YS_LH_JIJIANTZ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_LH_JIJIANTZsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_LH_JIJIANTZsDynamic(UpdateValue, WhereClause, null);
        }


        #endregion
        #region Private

        private int InsertYS_LH_JIJIANTZ(YS_LH_JIJIANTZ YS_LH_JIJIANTZ, OracleTransaction Transaction)
        {
            string spName = "CS_InsYS_LH_JIJIANTZ";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_LH_JIJIANTZ.S_ZHANDIANBH;
            storedParams[1].Value = YS_LH_JIJIANTZ.S_LAIHANBH;
            storedParams[2].Value = YS_LH_JIJIANTZ.S_YONGHUH;
            storedParams[3].Value = YS_LH_JIJIANTZ.I_Y;
            storedParams[4].Value = YS_LH_JIJIANTZ.I_M1;
            storedParams[5].Value = YS_LH_JIJIANTZ.I_M2;
            storedParams[6].Value = YS_LH_JIJIANTZ.I_M3;
            storedParams[7].Value = YS_LH_JIJIANTZ.I_M4;
            storedParams[8].Value = YS_LH_JIJIANTZ.I_M5;
            storedParams[9].Value = YS_LH_JIJIANTZ.I_M6;
            storedParams[10].Value = YS_LH_JIJIANTZ.I_M7;
            storedParams[11].Value = YS_LH_JIJIANTZ.I_M8;
            storedParams[12].Value = YS_LH_JIJIANTZ.I_M9;
            storedParams[13].Value = YS_LH_JIJIANTZ.I_M10;
            storedParams[14].Value = YS_LH_JIJIANTZ.I_M11;
            storedParams[15].Value = YS_LH_JIJIANTZ.I_M12;
            storedParams[16].Value = YS_LH_JIJIANTZ.I_SHURUR;
            storedParams[17].Value = YS_LH_JIJIANTZ.D_SHURURQ;
            storedParams[18].Value = YS_LH_JIJIANTZ.I_JLZT;
            storedParams[19].Value = YS_LH_JIJIANTZ.I_LIUCHENGBH;
            storedParams[20].Value = YS_LH_JIJIANTZ.S_SHENPIYJ;
            storedParams[21].Value = YS_LH_JIJIANTZ.S_GUANLIKBH;
            storedParams[22].Value = YS_LH_JIJIANTZ.S_CAOZUORQM;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_LH_JIJIANTZ.ID = Convert.ToInt32(storedParams[23].Value);
            return result;
        }
        private bool UpdateYS_LH_JIJIANTZ(YS_LH_JIJIANTZ YS_LH_JIJIANTZ, OracleTransaction Transaction)
        {
            string spName = "CS_UpdYS_LH_JIJIANTZ";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_LH_JIJIANTZ.S_ZHANDIANBH;
            storedParams[1].Value = YS_LH_JIJIANTZ.S_LAIHANBH;
            storedParams[2].Value = YS_LH_JIJIANTZ.S_YONGHUH;
            storedParams[3].Value = YS_LH_JIJIANTZ.I_Y;
            storedParams[4].Value = YS_LH_JIJIANTZ.I_M1;
            storedParams[5].Value = YS_LH_JIJIANTZ.I_M2;
            storedParams[6].Value = YS_LH_JIJIANTZ.I_M3;
            storedParams[7].Value = YS_LH_JIJIANTZ.I_M4;
            storedParams[8].Value = YS_LH_JIJIANTZ.I_M5;
            storedParams[9].Value = YS_LH_JIJIANTZ.I_M6;
            storedParams[10].Value = YS_LH_JIJIANTZ.I_M7;
            storedParams[11].Value = YS_LH_JIJIANTZ.I_M8;
            storedParams[12].Value = YS_LH_JIJIANTZ.I_M9;
            storedParams[13].Value = YS_LH_JIJIANTZ.I_M10;
            storedParams[14].Value = YS_LH_JIJIANTZ.I_M11;
            storedParams[15].Value = YS_LH_JIJIANTZ.I_M12;
            storedParams[16].Value = YS_LH_JIJIANTZ.I_SHURUR;
            storedParams[17].Value = YS_LH_JIJIANTZ.D_SHURURQ;
            storedParams[18].Value = YS_LH_JIJIANTZ.I_JLZT;
            storedParams[19].Value = YS_LH_JIJIANTZ.I_LIUCHENGBH;
            storedParams[20].Value = YS_LH_JIJIANTZ.S_SHENPIYJ;
            storedParams[21].Value = YS_LH_JIJIANTZ.S_GUANLIKBH;
            storedParams[22].Value = YS_LH_JIJIANTZ.S_CAOZUORQM;
            storedParams[23].Value = YS_LH_JIJIANTZ.ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_LH_JIJIANTZ PopulateYS_LH_JIJIANTZ(IDataReader dr)
        {
            YS_LH_JIJIANTZ YS_LH_JIJIANTZ = new YS_LH_JIJIANTZ();
            YS_LH_JIJIANTZ.S_ZHANDIANBH = dr["S_ZHANDIANBH"] == DBNull.Value ? null : (string)dr["S_ZHANDIANBH"];
            YS_LH_JIJIANTZ.S_LAIHANBH = dr["S_LAIHANBH"] == DBNull.Value ? null : (string)dr["S_LAIHANBH"];
            YS_LH_JIJIANTZ.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? null : (string)dr["S_YONGHUH"];
            YS_LH_JIJIANTZ.I_Y = dr["I_Y"] == DBNull.Value ? null : (decimal?)dr["I_Y"];
            YS_LH_JIJIANTZ.I_M1 = dr["I_M1"] == DBNull.Value ? null : (decimal?)dr["I_M1"];
            YS_LH_JIJIANTZ.I_M2 = dr["I_M2"] == DBNull.Value ? null : (decimal?)dr["I_M2"];
            YS_LH_JIJIANTZ.I_M3 = dr["I_M3"] == DBNull.Value ? null : (decimal?)dr["I_M3"];
            YS_LH_JIJIANTZ.I_M4 = dr["I_M4"] == DBNull.Value ? null : (decimal?)dr["I_M4"];
            YS_LH_JIJIANTZ.I_M5 = dr["I_M5"] == DBNull.Value ? null : (decimal?)dr["I_M5"];
            YS_LH_JIJIANTZ.I_M6 = dr["I_M6"] == DBNull.Value ? null : (decimal?)dr["I_M6"];
            YS_LH_JIJIANTZ.I_M7 = dr["I_M7"] == DBNull.Value ? null : (decimal?)dr["I_M7"];
            YS_LH_JIJIANTZ.I_M8 = dr["I_M8"] == DBNull.Value ? null : (decimal?)dr["I_M8"];
            YS_LH_JIJIANTZ.I_M9 = dr["I_M9"] == DBNull.Value ? null : (decimal?)dr["I_M9"];
            YS_LH_JIJIANTZ.I_M10 = dr["I_M10"] == DBNull.Value ? null : (decimal?)dr["I_M10"];
            YS_LH_JIJIANTZ.I_M11 = dr["I_M11"] == DBNull.Value ? null : (decimal?)dr["I_M11"];
            YS_LH_JIJIANTZ.I_M12 = dr["I_M12"] == DBNull.Value ? null : (decimal?)dr["I_M12"];
            YS_LH_JIJIANTZ.I_SHURUR = dr["I_SHURUR"] == DBNull.Value ? null : (decimal?)dr["I_SHURUR"];
            YS_LH_JIJIANTZ.D_SHURURQ = dr["D_SHURURQ"] == DBNull.Value ? null : (DateTime?)dr["D_SHURURQ"];
            YS_LH_JIJIANTZ.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?)dr["I_JLZT"];
            YS_LH_JIJIANTZ.ID = dr["ID"] == DBNull.Value ? (decimal)0 : (decimal)dr["ID"];
            YS_LH_JIJIANTZ.I_LIUCHENGBH = dr["I_LIUCHENGBH"] == DBNull.Value ? null : (decimal?)dr["I_LIUCHENGBH"];
            YS_LH_JIJIANTZ.S_SHENPIYJ = dr["S_SHENPIYJ"] == DBNull.Value ? null : (string)dr["S_SHENPIYJ"];
            YS_LH_JIJIANTZ.S_GUANLIKBH = dr["S_GUANLIKBH"] == DBNull.Value ? null : (string)dr["S_GUANLIKBH"];
            YS_LH_JIJIANTZ.S_CAOZUORQM = dr["S_CAOZUORQM"] == DBNull.Value ? null : (string)dr["S_CAOZUORQM"];
            return YS_LH_JIJIANTZ;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
            }
        }
        #endregion
    }
}
#endregion